#pragma once
#include <iostream>
#include <string>
#include <ctime>

//此数1234仅仅是方便我们区分，无实际意义！
#define NORMAL 1
#define WARNING 2
#define DEBUG 3
#define FATAL 4

//日志头文件

//在宏参中带#LEVEL可以将宏名称转为字符串（将宏定义中的传入参数名转换成用一对双引号括起来参数名字符串）,__FILE__和__LINE__用于获取调用文件的文件名和行号
#define LOG(LEVEL,MESSAGE) log(#LEVEL,MESSAGE,__FILE__,__LINE__)

void log(std::string level,std::string message,std::string file,int line)
{
    std::cout << "[" << level << "]" << "[" << time(nullptr) << "]" << "[" << message << "]" << "[" << file << "]" << "[" << line << "]" << std::endl;
} 